package com.tchintech.pay.view.activity;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.tchintech.pay.R;
import com.tchintech.pay.delegate.BalanceAccountDelegate;
import com.tchintech.pay.frame.presenter.ActivityPresenter;

/**
 * Created by Administrator on 2017/9/1 0001.
 * 余额界面
 */

public class BalanceAccountActivity extends ActivityPresenter<BalanceAccountDelegate> implements View.OnClickListener {
    private Intent intent;
    private String usableM;
    private TextView tv_ye;

    @Override
    protected void initView() {
        super.initView();
        viewDelegate.setTv_right("明细");
        viewDelegate.setOnClickListener(this, R.id.tv_right, R.id.iv_back, R.id.real_tx, R.id.real_ch);
        tv_ye = viewDelegate.get(R.id.tv_ye);
        tv_ye.setText(usableM);
    }

    @Override
    protected void initData() {
        super.initData();
        intent = new Intent();
        usableM = getIntent().getStringExtra("usableM");
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_right:
                //明细
                intent.setClass(this, AllMoneyActivity.class);
                intent.putExtra("state", 2);
                startActivity(intent);
                break;
            case R.id.real_tx:
                // showMsg("提现");
                intent.setClass(this, TixianActivity.class);
                intent.putExtra("usableM", usableM);
                startActivity(intent);
                break;
         /*   case R.id.real_ch:
                showMsg("充值");
                break;*/
            case R.id.iv_back:
                finish();
                break;
            default:
                showMsg("正在开发中，敬请期待...");
                break;
        }
    }

    @Override
    protected Class<BalanceAccountDelegate> getDelegateClass() {
        return BalanceAccountDelegate.class;
    }
}

